<template>
    <div>
        <el-menu :default-active="activeIndex" 
        class="el-menu-demo" 
        mode="horizontal" 
        @select="handleSelect" 
        router 
        text-color="#1E90FF">
            <el-menu-item :index="activeIndex+'/preview'">源文档预览</el-menu-item>
            <el-menu-item :index="activeIndex+'/edit'">编辑</el-menu-item>
            <el-menu-item :index="archive_string">返回文集页</el-menu-item>
            <el-menu-item index='/home'>返回用户页</el-menu-item>
        </el-menu>
    </div>
</template>
  
<script>
export default {
    data(){
        return{
            userId_string:''
        }
    },
    created(){
        var tmp = this.$route.path;
        tmp=tmp.replace('/preview','');
        tmp=tmp.replace('/edit','');
        this.activeIndex = tmp;
        //获取userId
        this.archive_string=this.activeIndex.substring(0,(this.activeIndex.indexOf('/doc/')));
        console.log(this.userId_string);
    },

}
</script>

<style>
</style>